Skip to main content

Import SMR Catalogue file

This will import catalogue of SMR job items with costs for a given customer and supplier.

NOTE:

Max allowed file size is 1.1Mb.

Fields

Field NameDescriptionDatatypeValidationMax lengthMandatoryExample
Supplieraccount Id/group IdstringValid stringUnlimitedYesjBybqdJA9wZQHEmLQDai
Product

Type of catalogue (This is not required
for the import, but used as a reference i
in the file)

NANANANASMR
Vehicle IdentifierUnique Id for a vehicle Make & ModelstringAllow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern.UnlimitedNo12345678
Repair Type IdUnique Id issues by ViSNstringAllow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern.UnlimitedYes9239238
Repair DescriptionBrief description of the job item Allow string that consists only of uppercase and lowercase letters, digits, underscores, at symbols, periods, forward slashes, hash symbols, ampersands, plus signs, hyphens, parentheses, square brackets, and double quotes. It will not allow any strings that contain other characters or characters that are not included in the pattern. (Filters) Fuel ERACFUEL
MakeVehicle MakestringAllow any string that consists only of hyphens, plus signs, word characters, and whitespace characters. It will not allow any strings that contain other characters or characters that are not included in the pattern.UnlimitedYesCITROEN
ModelVehicle ModelstringValid stringUnlimitedYesGRAND C4 SPACETOURER
Net CostCostdecimalvalid number Yes45.90

Combination of Make, Model, Vehicle Identifier and Repair Id must be unique. The combination of these fields is used to generate document id, for example BMW, SERIES 2, 1300087 and 2220016 generates a key bmw-series-2-2220016-1300087

Importing a file

Preparation

  1. Create a new branch with Jira task number in the branch name

  2. Delete all the files in importFiles folder

  3. Create a folder with the current sprint number

  4. Copy the file that needs to be imported

  5. Go to package.json , find the line validate:smrPriceCatalogue

  6. Modify --leaseId with the required lease Id

  7. Modify --file with the relative path of the file

  8. Save package.json

Validating locally

  1. in a terminal run npm run validate:smrPriceCatalogue

  2. If there are no errors, push the code

Validating in workflow

  1. Go to Action of Import-manger

  2. Find <Environment> - on-demand-import

  3. Select the branch that was created for this import

  4. Enter script name as validate:smrPriceCatalogue

  5. Leave Overrides empty

Importing the file

  1. If the validation has passed

  2. Go to Action of Import-manger

  3. Find <Environment> - on-demand-import

  4. Select the branch that was created for this import

  5. Enter script name as validate:smrPriceCatalogue

  6. Enter --persist in Overrides field

Testing

  1. A folder will be created (if not already exists) in Firestore, under the /accounts/<accountId from the import file>/cataloguePrice/<lease Id from package.json>/smr

  2. New documents will be added in Algolia > smrCatalogueIndex

Status: Accepted
Category: Protected
Authored By: Vishwa on Mar 26, 2023
Revisions.